using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class NoGenerateMap : EntityTypeConfiguration<NoGenerate>
	{
		public NoGenerateMap()
		{
			// Primary Key
			this.HasKey(t => t.Id);

			// Properties
			this.Property(t => t.Date)
				.IsRequired()
				.IsFixedLength()
				.HasMaxLength(8);
				
			this.Property(t => t.Remark)
				.HasMaxLength(50);
				
			// Table & Column Mappings
			this.ToTable("NoGenerate");
			this.Property(t => t.Id).HasColumnName("Id");
			this.Property(t => t.Date).HasColumnName("Date");
			this.Property(t => t.NoType).HasColumnName("NoType");
			this.Property(t => t.LatestNo).HasColumnName("LatestNo");
			this.Property(t => t.Remark).HasColumnName("Remark");
		}
	}
}

